import { Body, Controller, HttpCode, Patch, Post, Get } from '@nestjs/common';
import { usr } from './dto/auth.dto';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { keys } from './dto/keys.dto';
import { UserService } from './user.service';
import { refill } from './dto/refill.dto';

@Controller('user')
export class UserController {
	constructor(private readonly userService: UserService) {}

	@HttpCode(200)
	@Patch('/login')
	login(@Body() keys: keys) {
		return this.userService.loginUser(keys);
	}

	@HttpCode(200)
	@Post('/auth')
	authCheck(@Body() user: usr) {
		return this.userService.authCheck(user);
	}

	@HttpCode(200)
	@Post('/balance')
	checkBalance(@Body() user: usr) {
		return this.userService.checkBalance(user);
	}

	@HttpCode(200)
	@Post('/listTrans')
	loadTransactions(@Body() user: usr) {
		return this.userService.checkTransactionList(user);
	}

	@HttpCode(200)
	@Post('/refill')
	refillBalance(@Body() transaction: refill) {
		return this.userService.refill(transaction);
	}

	@HttpCode(200)
	@Get('/updateNotification')
	updateNotification() {
		return this.userService.updateNotification();
	}
}
